package com.kongwg.java;

import org.junit.Test;

import java.util.Date;

/**
 * @author kongwg
 * @create 2020-12-07 18:08
 */
public class DateTimeTest {
    @Test
    public void test(){
    Date date1 = new Date();
    System.out.println(date1.toString());

    Date date2 = new Date(198289129892388L);
        System.out.println(date2);

    //创建java.sql.date对象
        java.sql.Date date3 = new java.sql.Date(82938298283L);
        System.out.println(date3);
    //如何将java.util.Date对象转换为java.sql.Date对象
    Date date4 = new Date();

    java.sql.Date date5 = new java.sql.Date(date4.getTime());
        System.out.println(date5.toString());

    }


}
